package com.bwda.dsrs.filecenter.condition;

import com.bwda.dsrs.filecenter.domain.po.dataleveltyperel.DataLevelTypeRelPo;
import com.bwda.dsrs.filecenter.domain.po.datasensitivewords.DataSensitiveWordsPo;
import com.bwda.dsrs.filecenter.domain.po.dbinfo.DbInfoPo;
import com.bwda.dsrs.filecenter.service.IRemoteService;
import lombok.Data;

import java.sql.Connection;
import java.util.List;
/**
 * @author Administrator
 */
@Data
public class DbScanTableHandleParams {
	private Integer taskId;
	private Integer taskHistoryId;
	private IRemoteService iRemoteService;
	private Connection connection;
	private DbInfoPo db;
	private String tableName;
	private Integer rowNum;
	private Integer sumRowNum;
	private Integer typeDependentNum;
	private List<DataSensitiveWordsPo> dataSensitiveWordsPos;
	private List<DataLevelTypeRelPo> dataLevelTypeRelPos;

	public DbScanTableHandleParams() {
	}

	private DbScanTableHandleParams(Builder builder) {
		this.taskId = builder.taskId;
		this.taskHistoryId = builder.taskHistoryId;
		this.iRemoteService = builder.iRemoteService;
		this.connection = builder.connection;
		this.db = builder.db;
		this.tableName = builder.tableName;
		this.rowNum = builder.rowNum;
		this.typeDependentNum = builder.typeDependentNum;
		this.dataSensitiveWordsPos = builder.dataSensitiveWordsPos;
		this.dataLevelTypeRelPos = builder.dataLevelTypeRelPos;
		this.sumRowNum = builder.sumRowNum;
	}

	public static Builder newDbScanTableHandleParams() {
		return new Builder();
	}

	public static final class Builder {
		private Integer taskId;
		private Integer taskHistoryId;
		private IRemoteService iRemoteService;
		private Connection connection;
		private DbInfoPo db;
		private String tableName;
		private Integer rowNum;
		private Integer typeDependentNum=2;
		private List<DataSensitiveWordsPo> dataSensitiveWordsPos;
		private List<DataLevelTypeRelPo> dataLevelTypeRelPos;
		private Integer sumRowNum;

		private Builder() {
		}

		public DbScanTableHandleParams build() {
			return new DbScanTableHandleParams(this);
		}

		public Builder taskId(Integer taskId) {
			this.taskId = taskId;
			return this;
		}

		public Builder taskHistoryId(Integer taskHistoryId) {
			this.taskHistoryId = taskHistoryId;
			return this;
		}

		public Builder iRemoteService(IRemoteService iRemoteService) {
			this.iRemoteService = iRemoteService;
			return this;
		}

		public Builder connection(Connection connection) {
			this.connection = connection;
			return this;
		}

		public Builder db(DbInfoPo db) {
			this.db = db;
			return this;
		}

		public Builder tableName(String tableName) {
			this.tableName = tableName;
			return this;
		}

		public Builder rowNum(Integer rowNum) {
			this.rowNum = rowNum;
			return this;
		}

		public Builder typeDependentNum(Integer typeDependentNum) {
			this.typeDependentNum = typeDependentNum;
			return this;
		}

		public Builder dataSensitiveWordsPos(List<DataSensitiveWordsPo> dataSensitiveWordsPos) {
			this.dataSensitiveWordsPos = dataSensitiveWordsPos;
			return this;
		}

		public Builder dataLevelTypeRelPos(List<DataLevelTypeRelPo> dataLevelTypeRelPos) {
			this.dataLevelTypeRelPos = dataLevelTypeRelPos;
			return this;
		}

		public Builder sumRowNum(Integer sumRowNum) {
			this.sumRowNum = sumRowNum;
			return this;
		}
	}
}